home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWMemory / Include / FWMemTas.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.0 KB  |  88 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWMemTas.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWMEMTAS_H
  11. #define FWMEMTAS_H
  12.  
  13. #ifndef FWMEMMGR_H
  14. #include "FWMemMgr.h"
  15. #endif
  16.  
  17. #if FW_LIB_EXPORT_PRAGMAS
  18. #pragma lib_export on
  19. #endif
  20.  
  21. //========================================================================================
  22. // Forward class declarations
  23. //========================================================================================
  24.  
  25. struct MemHeap;
  26.  
  27. //========================================================================================
  28. // Struct FW_SPrivMemoryGlobals
  29. //========================================================================================
  30.  
  31. #ifdef FW_BUILD_MAC
  32. #pragma options align=mac68k
  33. #endif
  34.  
  35. #ifdef FW_BUILD_WIN
  36. #pragma pack(push, 1)
  37. #endif
  38.  
  39. struct FW_SPrivMemoryGlobals
  40. {
  41.     MemHeap* gMemoryHeap;                    // The heap
  42.     FW_PFVV gNewHandler;                    // The new handler
  43.     unsigned long gLastRequested;            // The last requested block size
  44.     short gInitialized;
  45. };
  46.  
  47. #ifdef FW_BUILD_MAC
  48. #pragma options align=reset
  49. #endif
  50.  
  51. #ifdef FW_BUILD_WIN
  52. #pragma pack(pop)
  53. #endif
  54.  
  55. //========================================================================================
  56. // CLASS FW_CMemoryTaskGlobals
  57. //========================================================================================
  58.  
  59. class FW_CLASS_ATTR FW_CMemoryTaskGlobals
  60. {
  61. public:
  62.     static FW_SPrivMemoryGlobals& GetMemoryGlobals();
  63.  
  64.     static void SetMemoryHeap(MemHeap* aMemoryHeap);
  65.     
  66.     static void Initialize(FW_SPrivMemoryGlobals& memGlobals);
  67.     static void Terminate();
  68.  
  69.     static void InitializeMemoryHeap(FW_SPrivMemoryGlobals& memGlobals);
  70.     static void TerminateMemoryHeap();
  71.  
  72. private:
  73.  
  74.     enum {kMemoryGlobalsOffset = 126};
  75.     
  76.     FW_CMemoryTaskGlobals();
  77.  
  78. private:
  79.     static FW_SPrivMemoryGlobals gGlobals;
  80. };
  81.  
  82.  
  83. #if FW_LIB_EXPORT_PRAGMAS
  84. #pragma lib_export off
  85. #endif
  86.  
  87. #endif
  88.